<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../template/StakeholderTemplate.xhtml">

    <ui:define name="contentInsert">
        
        <h3>Delete Outlet</h3>
        <h:form>
            <p:panel id="panel" >
                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" />
                    </f:facet>
                    <f:facet name="complete"> 
                        <h:outputText value="" />
                    </f:facet>
                </p:ajaxStatus>
                <p:messages />

                <br/>
                <br/>
                
                <p:dataTable value="#{outletManagerBean.getAllOutlets()}" var="o" paginator="true" rows="15"
                             styleClass="order-table"
                             >

                    <p:column>
                        <f:facet name="header">Outlet Id</f:facet>
    			#{o.id}
                    </p:column>

                    <p:column filterBy="#{o.outletName}" filterMatchMode="contains">
                        <f:facet name="header">Outlet Name</f:facet>
    			#{o.outletName}
                    </p:column>

                    <p:column>
                        <f:facet name="header">Phone Number</f:facet>
    			#{o.phoneNumber}
                    </p:column>

                    <p:column>
                        <f:facet name="header">Action</f:facet>
                        <h:commandLink value="Delete" onclick="if (!confirm('Are you sure you want to delete outlet?')) return false"
                                       action="#{outletManagerBean.deleteOutlet(o)}" />
                    </p:column>

                </p:dataTable>
            </p:panel>
        </h:form>
        
        
        
        

    </ui:define>

</ui:composition>